/*
* SMILParser
*
* Version 1.0
*
* Programmers: Jesse Louderback, Noah Pham, Chad Carpenter, and Marc Hindman
*/
package com.SmilDial;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;

public class LoadingScreenSoundMenu extends Activity {
	Bundle SMIL_Bundle;
	
	//Introduce an delay
    private final int WAIT_TIME = 100;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.loading_screen);
		findViewById(R.id.mainSpinner1).setVisibility(View.VISIBLE);
		
		//Gets the bundle from last intent, ImageMenu.java
        SMIL_Bundle = getIntent().getExtras();

		new Handler().postDelayed(new Runnable() { 
			public void run() {
				
	            //Simulating a long running task
	            try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			  
			    // Create an Intent that will start the ProfileData-Activity.
		        Intent mainIntent = new Intent(LoadingScreenSoundMenu.this, SoundMenu.class);
		        mainIntent.putExtras(SMIL_Bundle);
			    LoadingScreenSoundMenu.this.startActivity(mainIntent); 
			    LoadingScreenSoundMenu.this.finish(); 
			} 
		}, WAIT_TIME);
    }
}
